<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<div id="app">
    <p>currentTime1：{{currentTime1()}}</p>
    <p>currentTime2：{{currentTime2}}</p>
</div>



<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            message: "hello vue!"
        },
        methods: {
            currentTime1: function () {
                return Date.now();  // 返回一个时间戳
            }
        },
        computed: { // 计算属性：methods，computed 方法不能重名，重名之后只会调用methods中的方法
            currentTime2: function () {
                this.message;
                return Date.now();  // 返回一个时间戳
            }
        }
    });

</script>
</body>
</html>